#include <stdio.h>
#include <unistd.h>

#define PROGRESS_BAR_LENGTH 50
#define SLEEP_INTERVAL_US 100000

void displayProgressBar(int progress) {
    int i;

    printf("[");
    for (i = 0; i < PROGRESS_BAR_LENGTH; i++) {
	    if (i < progress * PROGRESS_BAR_LENGTH / 100) {
            printf("#");
        } else {
            printf("-");
        }
    }
    printf("] %d%%\r", progress);
    fflush(stdout);
}

void simulateLoading() {
    int progress;
    
    for (progress = 0; progress <= 100; progress += 1) {
        displayProgressBar(progress);
        usleep(SLEEP_INTERVAL_US);
    }
    printf("\nLoading complete!\n");
}

int main() {
    simulateLoading();

    return 0;
}

